home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000048_fj@iesd.auc.dk_Tue Oct 12 17:48:04 1993.msg < prev    next >
Internet Message Format  |  1994-10-11  |  2KB

  1. Received: from iesd.auc.dk by cs.umb.edu with SMTP id AA04572
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Tue, 12 Oct 1993 11:48:38 -0400
  3. Received: from loke.iesd.auc.dk by iesd.auc.dk with SMTP id AA25765
  4.   (5.65c8/IDA-1.5/MD for <tex-k@cs.umb.edu>); Tue, 12 Oct 1993 16:46:52 +0100
  5. Received: by loke.iesd.auc.dk id AA18012
  6.   (5.65c8/IDA-CLIENT/MD); Tue, 12 Oct 1993 16:48:04 +0100
  7. Date: Tue, 12 Oct 1993 16:48:04 +0100
  8. From: Frank Jensen <fj@iesd.auc.dk>
  9. Message-Id: <199310121548.AA18012@loke.iesd.auc.dk>
  10. To: tim@maths.tcd.ie
  11. Cc: tex-k@cs.umb.edu
  12. In-Reply-To: <9310121604.aa24885@salmon.maths.tcd.ie> (message from Timothy Murphy on Tue, 12 Oct 1993 16:04:19 (BST))
  13. Subject: Re: Speed of (recursive) search in the Kpathsearch library
  14.  
  15.  
  16. > > I'm sure most people have noticed the delay due to the recursive
  17. > > search of subdirectories when TeX starts up.  
  18. >
  19. > While your scheme seems a good idea to me,
  20. > it may be worth noting that Karl's subdirectory search algorithm
  21. > works best if each subdirectory in or below the search path
  22. > _either_ contains only subdirectories
  23. > _or_ contains only files.
  24. >
  25. > The first step in Karl's recursive algorithm
  26. > is to determine if the directory being examined
  27. > contains any subdirectories.
  28. > If it does, every file or subdirectory is "stat"ed,
  29. > which can take a non-negligible time,
  30. > particularly on a remote computer.
  31.  
  32. Actually, there are two steps in the file location procedure.  The
  33. first is a `set-up' step: we have to locate the possible target
  34. directories to use when searching for files.  This is, as you note, a
  35. recursive procedure that is most efficient if each directory contains
  36. either subdirectories or files.  The output of this step is a list of
  37. (sub)directories.
  38.  
  39. The second step is where the actual file search takes place: we simply
  40. try to open the file in each directory on the previously produced list
  41. until we get a `hit'.
  42.  
  43. As you note, the time spent in the first step is very large if we do
  44. not carefully organize the directory hierarchy such that ordinary
  45. files are in leaf-directories only.  However, in my set-up, there are
  46. currently 75 directories, and only a few ordinary files (typically
  47. READMEs) have slipt into non-leaf directories.  When the list of
  48. directories gets this large, the second step also begins to be
  49. noticable.
  50.  
  51. /Frank